package org.lgiavedoni.android.franq.core.contact;

public class ContactPhone {
	public static enum PhoneType {

		TYPE_CUSTOM(0), TYPE_HOME(1), TYPE_MOBILE(2), TYPE_WORK(3), TYPE_FAX_WORK(4), TYPE_FAX_HOME(5), TYPE_PAGER(6), TYPE_OTHER(7), TYPE_CALLBACK(8), TYPE_CAR(9), TYPE_COMPANY_MAIN(
				10), TYPE_ISDN(11), TYPE_MAIN(12), TYPE_OTHER_FAX(13), TYPE_RADIO(14), TYPE_TELEX(15), TYPE_TTY_TDD(16), TYPE_WORK_MOBILE(17), TYPE_WORK_PAGER(18), TYPE_ASSISTANT(
				19), TYPE_MMS(20);

		int value;

		PhoneType(int value) {
			this.value = value;
		}
	}

	private String number;
	private PhoneType type;

	public ContactPhone(String number, PhoneType type) {
		super();
		this.number = number;
		this.type = type;
	}

	public ContactPhone(String number, int type) {
		super();
		this.number = number;
		this.type = getPhoneType(type);
	}

	public static PhoneType getPhoneType(int type) {
		for (PhoneType type2 : PhoneType.values()) {
			if (type == type2.value)
				return type2;
		}
		return null;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public PhoneType getType() {
		return type;
	}

	public void setType(PhoneType type) {
		this.type = type;
	}

}
